function a(a, t, e) {
    return t in a ? Object.defineProperty(a, t, {
        value: e,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : a[t] = e, a;
}

var t, e = getApp();

Page((t = {
    data: {
        storeList: [],
        page: 1,
        limit: 20,
        hasMore: !0,
        baseUrl: e.globalData.baseUrl,
        pagename: ""
    },
    onLoad: function(a) {
        var t = e.globalData.urlBase + e.globalData.urlStoreList;
        this.setData({
            pagename: a.page
        }), this.getinitData(t);
    },
    getinitData: function(a) {
        var t = this;
        t.data.hasMore && wx.request({
            url: a,
            data: {
                lng: e.globalData.lng,
                lat: e.globalData.lat,
                page: t.data.page,
                limit: t.data.limit
            },
            method: "POST",
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(a) {
                var e = JSON.parse(a.data);
                0 != e.code && wx.showToast({
                    title: "获取经纬度失败,请打开定位",
                    icon: "none",
                    duration: 2e3
                });
                var o = t.data.page, n = t.data.storeList;
                e.storeList.length < t.data.limit ? t.setData({
                    storeList: n.concat(e.storeList),
                    hasMore: !1,
                    page: o + 1
                }) : t.setData({
                    storeList: n.concat(e.storeList),
                    hasMore: !0,
                    page: o + 1
                });
            }
        });
    },
    chooseStore: function(a) {
        e.globalData.storeId = a.currentTarget.dataset.storeid, "yy" == this.data.pagename ? wx.switchTab({
            url: "../index/index"
        }) : "tg" == this.data.pagename ? wx.switchTab({
            url: "../product/index"
        }) : "hd" == this.data.pagename ? wx.switchTab({
            url: "../activity/activity"
        }) : "hy" == this.data.pagename ? wx.switchTab({
            url: "../huiyuan/huiyuan"
        }) : "md" == this.data.pagename && wx.navigateTo({
            url: "../modulePurchase/pagePay"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
}, a(t, "onPullDownRefresh", function() {}), a(t, "onReachBottom", function() {
    var a = e.globalData.urlBase + e.globalData.urlStoreList;
    this.getinitData(a);
}), t));